public class Book {
    private String bookName;
    private String author;
    private String publisher;
    private String date;
    public Book(){
        this("","", "","");
    }
    public Book(String initbookname, String initauthor, String initpublisher, String initdate){
        bookName = initbookname;
        author = initauthor;
        publisher = initpublisher;
        date = initdate;
    }
    public String getAuthor() {
        return author;
    }
    public String getBookName() {
        return bookName;
    }
    public String getDate() {
        return date;
    }
    public String getPublisher() {
        return publisher;
    }
    public void setBookName(String newName){
        bookName = newName;
    }
    public void setAuthor(String newAuthor){
        author = newAuthor;
    }
    public void setPublisher(String newPublisher){
        publisher = newPublisher;
    }
    public void setDate(String newDate){
        date = newDate;
    }
    public String toString(){
        return ("BookName:"+bookName+"\nAuthor:"+author+"\nPublisher:"+publisher+"\nDate:"+date);
    }
    public boolean equals(Object obj){
        if(obj == null) return false;
        else{
            if(obj instanceof Book){
                Book book = (Book) obj;
                if(book.bookName == this.bookName && book.author == this.author && book.publisher == this.publisher && book.date ==this.date){
                    return true;
                }
            }
        }
        return false;
    }
}
